package com.yc.ioc.test.bean4;

import com.yc.ioc.test.bean4.other.Banana;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;

@Configuration
@ComponentScan(basePackages = "com.yc.test.bean4.other")
@PropertySource("classpath:application.properties")
public class AppConfig_3 {

    @Value("${spring.banana.id}")
    private int id;
    @Bean
    public Banana banana() {
        Banana banana = new Banana();
        banana.setId(id);

        return  banana;
    }
}
